﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sail.Localization;
using Sail.Logging;

namespace Sail
{
    /// <summary>
    /// 为每个工作单元(即网络请求)的实例提供的接口
    /// </summary>
    public interface IDependency
    {
    }

    /// <summary>
    /// 为每个框架的实例提供的接口
    /// </summary>
    public interface ISingletonDependency : IDependency
    {
    }

    /// <summary>
    /// 为每个工作单元的实例提供的接口
    /// 这个接口用来保证某个实例不被一个单例所依赖
    /// </summary>
    public interface IUnitOfWorkDependency : IDependency
    {
    }

    /// <summary>
    /// 为每个处理的实例提供的接口
    /// </summary>
    public interface ITransientDependency : IDependency
    {
    }
   
    /// <summary>
    /// 日志组件
    /// </summary>
    public abstract class Component : IDependency
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        protected Component()
        {
            Logger = NullLogger.Instance;
            T = NullLocalizer.Instance;
        }

        /// <summary>
        /// 日志记录者
        /// </summary>
        public ILogger Logger { get; set; }

        /// <summary>
        /// 定位器
        /// </summary>
        public Localizer T { get; set; }
    }
}
